/**
 * @fileoverview lyricViewer 定义程序
 * @author dron
 * @date lyricViewer
 */

void function(){
	var module = System.nameSpace("{systemName}.modules.lyricViewer");
	module.initialize();

	var lyric = [
		"不要疯狂地迷恋我",
		"我只是个传说",
		"咱们的世界这样大",
		"事情如此多jb"
		"jb"
	];

	var lyricIndex = 0;
	var playLyric = function(){
		var lyr = lyric[lyricIndex ++];
		if(lyricIndex == lyric.length)
			lyricIndex = 0;

		module.setText(lyr);
		module.setSentenceWidth(0);

		var slength = 0;
		var nowWidth = 0;

		var playing = function(){
			nowWidth += 20;
			if(nowWidth > slength){
				nowWidth = slength;
				setTimeout(playLyric, 500);
			}else{
				setTimeout(playing, 50);
			}
			module.setSentenceWidth(nowWidth);
		};

		slength = lyr.length * 48 + 20;
		nowWidth = 0;

		playing();
	};

	playLyric();

	var drag = new Ucren.BasicDrag();
	drag.bind("dragHandle");
}();